<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center lookQuotation_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub lookQuotation_fd0_0'>
					<view class='flex flex-wrap align-center lookQuotation_fd0_0_c0' @tap="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  lookQuotation_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<text class='lookQuotation_fd0_0_c1'>查看报价</text>
					<view class='flex flex-wrap align-center lookQuotation_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view
				class="flex flex-direction flex-wrap align-stretch justify-between benben-position-layout flex lookQuotation_flex_1"
				:style="{top:(88+StatusBarRpx)+'rpx', }">
				<view class='flex flex-wrap align-center'>
					<view>
						<benben-flex-tabs class-name='lookQuotation_benbenTabsfd1_0_c0' v-model="tabs"
							ref="benben_tabsfd1_0_c0" select-mark="benben_tabsfd1_0_c0" key="benben_tabsfd1_0_c0"
							:open-title-type='false' :open-sticky='false' :top='0' :is-show-content='false'
							:scrollspy='false' :tabs-info.sync="tabsInfofd1_0_c0" @change="getBiddingFunc()">

							<scroll-view @scroll="tabsInfofd1_0_c0.scrollX = $event.detail.scrollLeft"
								id="benben_tabsfd1_0_c0" class="benben-tabs" style="width:750rpx" :scroll-x="true"
								:scroll-left.sync="tabsInfofd1_0_c0.moveX" scroll-with-animation="all .3s ease">
								<view class="benben-tabs-content" id="benben_tabsfd1_0_c0-content">
									<view id="benben_tabsfd1_0_c0-title"
										class="benben-tabs-title flex flex align-center justify-around">
										<view
											:class="{ 'checkTitlefd1_0_c0': tabs == '1', 'flex flex-wrap align-center': true }"
											@tap="tabs = '1'" :id="`benben_tabsfd1_0_c0-title-item-${'1'}`">

											<text>综合</text>

										</view>
										<view
											:class="{ 'checkTitlefd1_0_c0': tabs == '2', 'flex flex-wrap align-center': true }"
											@tap="tabs = '2'" :id="`benben_tabsfd1_0_c0-title-item-${'2'}`">

											<text>好评优先</text>

										</view>
										<view
											:class="{ 'checkTitlefd1_0_c0': tabs == '3', 'flex flex-wrap align-center': true }"
											@tap="tabs = '3'" :id="`benben_tabsfd1_0_c0-title-item-${'3'}`">

											<text>距离优先</text>

										</view>
										<view
											:class="{ 'checkTitlefd1_0_c0': tabs == '4', 'flex flex-wrap align-center': true }"
											@tap="tabs = '4'" :id="`benben_tabsfd1_0_c0-title-item-${'4'}`">

											<text>次数优先</text>

										</view>
									</view>
									<view
										:style="{ left: tabsInfofd1_0_c0.lineleft, maxWidth: tabsInfofd1_0_c0.lineWidth ,}"
										id="benben_tabsfd1_0_c0-line"
										class="benben-tabs-line flex benben-flex-tabs-line lookQuotation_linefd1_0_c0">
									</view>
								</view>
							</scroll-view>

						</benben-flex-tabs>

					</view>
				</view>

			</view>
			<view :style="{height: '91rpx'}"></view>
			<view class="flex flex-wrap align-center justify-center benben-position-layout flex lookQuotation_flex_2"
				v-if=" biddingList.length!=''" :style="{top:(179+StatusBarRpx)+'rpx', }">
				<text class='lookQuotation_fd2_0' v-if=" biddingList.length!=''">已有师傅抢单报价，请选择师傅</text>

			</view>
			<view :style="{height: '75rpx'}" v-if=" biddingList.length!=''"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout lookQuotation_flex_3">
				<template v-for='(item,key0) in biddingList'>
					<view class='flex flex-direction flex-wrap align-stretch lookQuotation_fd3_0' :key='key0'>
						<view class='flex flex-wrap align-center flex-sub lookQuotation_fd3_0_c0'
							@tap.stop="handleJumpDiy" data-type="navigateTo"
							:data-url="`/pages/index/masterDetails/masterDetails?id=${item.id}`">
							<image class='lookQuotation_fd3_0_c0_c0' mode="aspectFit" :src='item.avatar'></image>
							<view
								class='flex flex-direction flex-wrap align-stretch flex-sub lookQuotation_fd3_0_c0_c1'>
								<view class='flex flex-wrap align-center lookQuotation_fd3_0_c0_c1_c0'>
									<text class='flex-sub lookQuotation_fd3_0_c0_c1_c0_c0'>{{item.nickname}}</text>
									<text class='lookQuotation_fd3_0_c0_c1_c0_c1'>接单量</text>
									<text class='lookQuotation_fd3_0_c0_c1_c0_c2'>{{item.order_count}}</text>
								</view>
								<view class='flex flex-wrap align-center lookQuotation_fd3_0_c0_c1_c0'>
									<view class='flex flex-wrap align-center'>
										<template v-for="starNum in [1,2,3,4,5]">
											<image v-if="item.start_count >= starNum" :key="starNum"
												class='lookQuotation_star1fd3_0_c0_c1_c1_c0' mode="aspectFit"
												:src='STATIC_URL+"105.png"'></image>
											<image v-else :key="starNum" class='lookQuotation_star1fd3_0_c0_c1_c1_c0'
												mode="aspectFit" :src='STATIC_URL+"104.png"'></image>
										</template>
									</view>
									<text class='lookQuotation_fd3_0_c0_c1_c1_c1'>{{item.start_count}}</text>
								</view>
								<view class='flex flex-wrap align-center'>
									<view class='flex flex-wrap align-center'>
										<text class='lookQuotation_fd3_0_c0_c1_c2_c0_c0'>距离</text>
										<text class='lookQuotation_fd3_0_c0_c1_c2_c0_c1'>{{item.distance}}</text>
									</view>
									<text class='lookQuotation_fd3_0_c0_c1_c2_c1'>师傅报价:</text>
									<text class='lookQuotation_fd3_0_c0_c1_c2_c2'>￥</text>
									<text class=' lookQuotation_fd3_0_c0_c1_c2_c3'>
										<text>{{ item.bidding_price | frontPrice }}</text>
										<text
											class=' lookQuotation_price2_fd3_0_c0_c1_c2_c3'>{{ item.bidding_price | laterPrice }}</text>
									</text>
								</view>
							</view>
						</view>
						<view class='flex flex-wrap align-center lookQuotation_fd3_0_c1'>
							<button class='lookQuotation_fd3_0_c1_c0'
								@tap.stop="postBiddingFunc(item.bidding_id)">确认服务</button>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"tabsInfofd1_0_c0": {
					lineleft: '',
					lineWidth: '',
					moveX: 0,
					scrollX: 0,
					PageScrollX: 0
				},
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"tabs": "1",
				"lng": "",
				"lat": "",
				"biddingList": [],
				"confirmData": {
					"zhifubianhao": "",
					"zhifujine": "",
					"countdown": "",
					"order_serve_id": "",
					"service_type": ""
				},
				"sort_field": "",
				"id": "158"
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {
				id
			} = options
			if (id !== undefined) this.id = id
			this.getBiddingFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.getBiddingFunc()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取竞价师傅信息
			getBiddingFunc() {
				this.minixPagingListsApi = global.apiUrls.post64df2413f26d3;
				this.pageingListApiMethod = 'get';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					order_id: this.id,
					lng: this.lng,
					lat: this.lat,
					sort_field: this.tabs
				}
				this.listData = [];
				this.biddingList = this.listData;
				this.pagingListToggle();

			},
			//确认服务
			async postBiddingFunc(biddingID) {
				//请求方法
				//数据验证

				let dataconfirmData = await this.$api.dbPost(global.apiUrls.post64df33d0d0d3a, {
					order_id: this.id,
					bidding_id: biddingID
				});
				if (!dataconfirmData) return
				if (dataconfirmData.data.code != 1) {
					this.$message.info(dataconfirmData.data.msg);
					return
				}
				let infoconfirmData = dataconfirmData.data;
				this.confirmData = infoconfirmData.data

				this.$urouter.redirectTo(
					`/pages/index/cashier/cashier?money=${this.confirmData.zhifujine}&countdown=${this.confirmData.countdown}&order_sn=${this.confirmData.zhifubianhao}&order_type=13&syccessType=3`
					);
			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.lookQuotation_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.lookQuotation_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.lookQuotation_fd0_0_c0_c0 {
		font-size: 32rpx;
		color: #333;
	}

	.lookQuotation_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.lookQuotation_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.lookQuotation_flex_1 {
		background: #fff;
		width: 750rpx;
		height: 91rpx;
		overflow: hidden;
		z-index: 10;
		top: 88rpx;
		background-size: 100% auto !important;
	}

	.lookQuotation_linefd1_0_c0 {
		background: var(--benbenbgColor2);
		width: 50rpx;
		height: 8rpx;
		top: 78rpx;
		background-size: 100% auto !important;
		border-radius: 8rpx;
	}

	.checkTitlefd1_0_c0 {
		font-weight: 500 !important;
		font-size: 32rpx !important;
		color: #E31D1A !important;
		background-color: rgba(255, 255, 255, 1) !important;
	}

	::v-deep .lookQuotation_benbenTabsfd1_0_c0 {
		background: #fff;
		width: 750rpx;
		height: 91rpx;
		white-space: nowrap;
		text-align: center;
		font-size: 32rpx;
		font-weight: 400;
		color: #999999;
	}

	.lookQuotation_flex_2 {
		background: rgba(255, 238, 223, 1);
		width: 750rpx;
		height: 75rpx;
		overflow: hidden;
		z-index: 10;
		top: 179rpx;
		background-size: 100% auto;
	}

	.lookQuotation_fd2_0 {
		font-size: 24rpx;
		font-weight: 400;
		color: #FF9D47;
		line-height: 33rpx;
	}

	.lookQuotation_flex_3 {
		padding: 20rpx 24rpx 0rpx 24rpx;
	}

	.lookQuotation_fd3_0_c1_c0 {
		background: rgba(227, 29, 26, 1);
		border-radius: 30rpx 30rpx 30rpx 30rpx;
		font-size: 28rpx;
		color: #fff;
		width: 170rpx;
		height: 61rpx;
		line-height: 61rpx;
		margin: 0rpx 0rpx 0rpx auto;
	}

	.lookQuotation_fd3_0_c1 {
		border-top: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.lookQuotation_price2_fd3_0_c0_c1_c2_c3 {
		font-size: 22rpx;
	}

	.lookQuotation_fd3_0_c0_c1_c2_c3 {
		color: #FF5050;
		font-weight: 700;
		line-height: 40rpx;
		font-size: 32rpx;
	}

	.lookQuotation_fd3_0_c0_c1_c2_c2 {
		font-size: 22rpx;
		font-weight: 900;
		color: #FF5050;
		line-height: 40rpx;
	}

	.lookQuotation_fd3_0_c0_c1_c2_c1 {
		font-size: 24rpx;
		font-weight: 500;
		color: #666666;
		margin: 0rpx 16rpx 0rpx auto;
		line-height: 33rpx;
	}

	.lookQuotation_fd3_0_c0_c1_c2_c0_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		line-height: 33rpx;
	}

	.lookQuotation_fd3_0_c0_c1_c2_c0_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		line-height: 33rpx;
		margin: 0rpx 10rpx 0rpx 0rpx;
	}

	.lookQuotation_fd3_0_c0_c1_c1_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		line-height: 33rpx;
		margin: 0rpx 0rpx 0rpx 10rpx;
	}

	.lookQuotation_star1fd3_0_c0_c1_c1_c0 {
		height: 24rpx;
		margin: 0rpx 5rpx 0rpx 0rpx;
		width: 24rpx;
	}

	.lookQuotation_star1fd3_0_c0_c1_c1_c0 {
		width: 24rpx;
		height: 24rpx;
		margin: 0rpx 5rpx 0rpx 0rpx;
	}

	.lookQuotation_fd3_0_c0_c1_c0_c2 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333333;
		line-height: 33rpx;
	}

	.lookQuotation_fd3_0_c0_c1_c0_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333333;
		line-height: 33rpx;
		margin: 0rpx 10rpx 0rpx 0rpx;
	}

	.lookQuotation_fd3_0_c0_c1_c0_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 700;
		line-height: 45rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		margin: 0rpx 24rpx 0rpx 0rpx;
	}

	.lookQuotation_fd3_0_c0_c1_c0 {
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.lookQuotation_fd3_0_c0_c1 {
		margin: 0rpx 16rpx 0rpx 24rpx;
	}

	.lookQuotation_fd3_0_c0_c0 {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50rpx 50rpx 50rpx 50rpx;
	}

	.lookQuotation_fd3_0_c0 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.lookQuotation_fd3_0 {
		background: rgba(255, 255, 255, 1);
		background-size: 100% auto;
		border-radius: 16rpx;
		padding: 0rpx 24rpx 0rpx 24rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}
</style>